cmake_minimum_required(VERSION 3.10)
project(mymuduo)
# mymuduo最终编译成so动态库，设置动态库的路径，放在根目录的Lib文件夹下面
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/libs)
#设置调试信息以及启动C++11语言标准
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -fPIC")

# 定义参与编译的源代码文件
aux_source_directory(./src SRC_LIST)

# 编译生成动态库
add_library(mymuduo SHARED  ${SRC_LIST})


# 测试
add_executable(test_server ./example/testserver.cc ${SRC_LIST})
target_link_libraries(test_server PUBLIC "-lpthread")